﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using NHibernate.Cfg;
using Sirocco.Entity;

namespace Sirocco.Setup
{
    public class QuickStart
    {
        public void CreateDatabase ()
        {
            Configuration config = new NHibernate.Cfg.Configuration();

            config.AddAssembly("Sirocco"); // add our assembly

            ISessionFactory factory = config.BuildSessionFactory(); // setup nhibernate session
            ISession session = factory.OpenSession();

            ITransaction transaction = session.BeginTransaction(); // start nhibernate transaction

            Country country = new Country();
            country.Code = "MY";
            country.Desc = "Malaysia";
            session.Update(country);
        }
    }
}
